package com.levy.contronller.javase.designModel.factory;

/**
 * 重点在工厂类是个接口类
 * 针对生成不同的对象比较方便，符合代码的 对新代码开放 对旧代码封闭的原则
 * Created by levy on 2018/7/21.
 */
public class MainClass {

    public static void main(String[] args) throws InstantiationException, IllegalAccessException {

        FruitFactory appleFactory = new AppleFactory();
        Fruit fruit = appleFactory.getFruit();
        fruit.get();


        FruitFactory babanaFactory = new BananaFactory();
        Fruit fruit2 = babanaFactory.getFruit();
        fruit2.get();




    }
}
